Repository navigation
Conversation
| from unitary.alpha.qudit_state_transform import qudit_to_qubit_unitary, num_bits | ||
| import numpy as np | ||
| import itertools | ||
| from itertools import combinations |
There was a problem hiding this comment.
Prefer import itertools then itertools.combinations below
"Use import statements for packages and modules only, not for individual types, classes, or functions."
https://google.github.io/styleguide/pyguide.html#22-imports
There was a problem hiding this comment.
Addressed in 813714d: this now uses import itertools and calls itertools.combinations(...).
| entanglement[j][i] = entanglement[i][j] | ||
| names = list(self.object_name_dict.keys()) | ||
| data_frame = pd.DataFrame(entanglement, index=names, columns=names) | ||
| print(data_frame.round(1)) |
There was a problem hiding this comment.
Should we return the data_frame (or some other result) instead of printing it?
Printing it seems generally unhelpful if we are using this within a game.
There was a problem hiding this comment.
Addressed in 813714d and the follow-up correctness commit 2c03bc9: the pairwise helper now returns a DataFrame instead of printing it. The follow-up also returns full-precision values and names the API get_mutual_information_table() to match what it computes.
| entropy = [0.0] * num_qubits | ||
| entropy_pair = np.zeros((num_qubits, num_qubits)) | ||
| entanglement = np.zeros((num_qubits, num_qubits)) | ||
| for i in range(num_qubits - 1): |
There was a problem hiding this comment.
I think this block is fairly tough to follow. I would add comments below or in the function's docstring to explain the implementation details.
There was a problem hiding this comment.
Addressed. I expanded the docstring/comments around the multipartite entropy calculation, and the follow-up 2c03bc9 makes the definition explicit: bipartite quantum mutual information for two objects and quantum dual total correlation for N > 2, with the corresponding entropy formula and reference.
|
@madcpf Thank you for this PR last year. It has been quite some time – could you let us know the status, and whether you are williing and interested in addressing the review comments above? |
# Conflicts: # unitary/alpha/quantum_world.py
|
@mhucka @dstrain115 Thanks for following up, and apologies for the long delay. I’ve updated the PR and am still interested in finishing it. I addressed the three review comments:
While revisiting the code I also found and fixed two related correctness issues in a separate follow-up commit: density matrices now preserve complex phase instead of reconstructing amplitudes from computational-basis frequencies, and the N > 2 case now uses the correct quantum dual-total-correlation entropy formula while the two-object case remains standard quantum mutual information. The branch is synced with current |
Update quantum world to